package san.service.demo;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.utils.Page;
import com.utils.cache.Ehcache;
import san.dao.HibernateDao;
import san.entity.demo.UpOrDownFile;

/**
 * 上传下载service
 */
@Service
@Transactional
public class UpOrDownService extends HibernateDao<UpOrDownFile, String>{

	@Ehcache(addOrdel=true)
	@Transactional(readOnly = true)
	public Page<UpOrDownFile> getAllFile(Page<UpOrDownFile> page) {
		return getAll(page);
	}

	@Transactional(readOnly = true)
	public UpOrDownFile getFileById(String id) {
		return get(id);
	}

	public void saveOrUpdateFile(UpOrDownFile file) {
		save(file);
	}

	public void removeFile(UpOrDownFile file) {
		delete(file);
	}

}
